package com.ynny.Dao;

import com.ynny.Dao.UserManagerDao;
import com.ynny.Entity.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class Userlmpl implements UserManagerDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Override
    public Users queryUserByNumber(String number) {
        String sql = "select * from users where number = ?";
        return jdbcTemplate.queryForObject(sql,new BeanPropertyRowMapper<Users>(Users.class),number);
    }
}
